import React from 'react';

function ContactList({ contacts, onEdit, onDelete }) {
    return (
        <ul>
            {contacts.map(contact => (
                <li key={contact.name}>
                    {contact.name} - {contact.phone} - {contact.address}
                    <button onClick={() => onEdit(contact)}>修改用户</button>
                    <button onClick={() => onDelete(contact.name)}>删除用户</button>
                </li>
            ))}
        </ul>
    );
}

export default ContactList;
